AI033
Modern Java in Action
Using Optional for Null-Safety
Learning Objectives
- Identify the semantic differences between null and an empty Optional
- Master the functional API: map, flatMap, filter, and ifPresent
- Implement best practices for using Optional in return types
- Refactor legacy null-checks into cleaner Optional pipelines